<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn"  uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<!-- 검색 목록 -->
		<div id="coun_list" style="height: 200px;">
			<div class="coun_list_col" style="height: 40px;">
				<p style="width: 100px;">계약번호</p>
				<p style="width: 100px;">상담번호</p>
				<p style="width: 100px;">사원번호</p>
				<p style="width: 100px;">사원명</p>
				<p style="width: 100px;">상품번호</p>
				<p style="width: 220px;">상품명</p>
				<p style="width: 110px;">대출신청액</p>
				<p style="width: 110px;">계약상태</p>
				<p style="width: 100px;">계약담당자</p>
				<p style="width: 150px;">계약등록일</p>
			</div>
			<c:choose>
				<c:when test="${empty lists }">
					<div>
						<br/>
						<b>검색된 데이타가 없습니다.</b>
						<br/>
					</div>
				</c:when>
				<c:otherwise>
					<c:forEach items="${lists }" var="list" varStatus="loop">
						<div class="coun_list_row" onclick="fnContEdit('${list.ct_no }')" style="cursor: pointer;" onmouseover="fnOver(this)" onmouseout="fnOut(this)">
							<p>${list.ct_no }</p>
							<p>${list.cs_no }</p>
							<p>${list.sa_no }</p>
							<p>${list.sa_nm }</p>
							<p>${list.pd_no }</p>
							<p>${list.pd_nm }</p>
							<p>${list.cs_loan }만원</p>
							<c:forEach items="${ctings }" var="cting" varStatus="loop">
								<c:if test="${cting.cd_grp2 eq  list.ct_ing}">
									<p>${cting.cd_grp2_nm }</p>
								</c:if>
							</c:forEach>
							<p>${list.rg_pp_nm}(${list.rg_pp })</p>
							<p>${fn:substring(list.rg_dt,0,16) }</p>
						</div>
					</c:forEach>
				</c:otherwise>
			</c:choose>
		</div>
		<div style="margin-top: 20px;">
			<c:if test="${paging.nowBlock gt 1 }">
				<a onclick="fnPaging(1)"><input type="button" value="맨첨"></a>
				<a onclick="fnPaging(${paging.startPage - 1})"><input type="button" value="이전"></a>
			</c:if>
			[
			<c:forEach var="i" begin="${paging.startPage }" end="${paging.endPage }">
				<c:choose>
					<c:when test="${paging.listPage eq i}">
						<a onclick="fnPaging(${i})"><font color="red" style="font-weight: bold;">${i}</font></a>
					</c:when>
					<c:otherwise>
						<a onclick="fnPaging(${i})">${i}</a>
					</c:otherwise>
				</c:choose>
			</c:forEach>				
			]
			<c:if test="${paging.nowBlock lt paging.totBlock }">
				<a onclick="fnPaging(${paging.endPage + 1})"><input type="button" value="다음"></a>
				<a onclick="fnPaging(${paging.totPage})"><input type="button" value="맨끝"></a>
			</c:if>
		</div>
</body>
</html>